﻿using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
using UnityEngine;

public class GameManager : MonoBehaviour
{
    public static GameManager Instance;
    public GameObject Prefab_Ball;

    public Transform born;

    public int socre = 0;

    public float time;
    public float timer = 0;
    void Awake()
    {
        Instance = this;
    }

    private void Start()
    {
        UIManager.Instance.Text_score.text = GameManager.Instance.socre.ToString();

        socre = 0;
        timer = 0;
    }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            GameObject go = Instantiate(Prefab_Ball, Vector3.zero, quaternion.identity);
            go.transform.position = born.position;
        }

        if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow))
        {
            Player.Instance.ChangeType(+1);
        }

        if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow))
        {
            Player.Instance.ChangeType(-1);
        }
    }
}
